<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp" %>
<form id="mp_add_Form" method="post">
    <table class="table">
        <tr>
                <th>菜单名称：</th>
                   <td>
                       <input type="text"
                              id="value"
                              name="value"
                              class="easyui-textbox"
                              data-options="required:true,missingMessage:'菜单不能为空！'"
                              style="height:30px;"/>
                   </td>
        </tr>
        <tr>
            <th>上级菜单：</th>
            <td>
                <input type="text" id="pid" name="pid"
                       class="easyui-combotree"
                       data-options="editable:false,width:200,panelHeight:500,
                                    url:'${ctx}/Wechat/treegrid',
                                    parentField:'pid',
                                    method:'get',
                                    valueField: 'value',
                                    textField: 'text'
                                    " style="height:30px;"
                />
            </td>
        </tr>
        <tr>
            <th>菜单类型：</th>
            <td colspan="3">
                <input id="type" name="type" class="easyui-combobox" data-options="editable:false,
                        valueField: 'value',
                        textField: 'text',
                        data: [
                        {text: 'click',value: 'click'},
                        {text: 'view',value: 'view'},
                        {text: 'scancode_push',value: 'scancode_push'},
                        {text: 'scancode_waitmsg',value: 'scancode_waitmsg'},
                        {text: 'pic_photo_or_album',value: 'pic_photo_or_album'},
                        {text: 'pic_weixin',value: 'pic_weixin'},
                        {text: 'location_select',value: 'location_select'},
                        {text: 'media_id',value: 'media_id'},
                        {text: 'view_limited',value: 'view_limited'},
                        ]" style="height:30px;width:230px;"/>
            </td>
        </tr>
        <tr id="isoutlinktr">
            <th>是否外链：</th>
            <td>
                <input id="IsOutLink" name="IsOutLink" class="easyui-combobox" data-options="editable:false,
                        valueField: 'value',
                        textField: 'text',
                        data: [
                        {text: 'true',value: 'true'},
                        {text: 'false',value: 'false'},
                        ]" style="height:30px;width:230px;"/>
            </td>
        </tr>
        <tr id="urltr">
            <th>Url：</th>
            <td colspan="3">
                <input type="text"
                       id="url"
                       name="url"
                       class="easyui-textbox"
                       style="height:30px;width:200px;"/>
            </td>
        </tr>
        <tr>
            <th>菜单描述：</th>
            <td colspan="3">
                <input class="easyui-textbox" data-options="multiline:true,height:80,width:500" id="menums" name="menums"/>
            </td>
        </tr>

    </table>
</form>
<script>
    $(document).ready(function(){
        $("#urltr").hide();
        $("#isoutlinktr").hide();
    });

    $("#type").combobox({
            onSelect: function () {
                connectionType = $("#type").combobox('getValue');
                if(connectionType == "view"){
                    $("#urltr").show();
                    $("#isoutlinktr").show();
                }else{
                    $("#urltr").hide();
                    $("#isoutlinktr").hide();
                }
            }
    })
</script>
</html>

